{include file="common/_meta"}

<title>基本设置</title>
</head>
<body>
{include file="common/_header"}
{include file="common/_menu"}

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span
            class="c-gray en">&gt;</span> 基本设置 <a class="btn btn-success radius r"
                                                  style="line-height:1.6em;margin-top:3px"
                                                  href="javascript:location.replace(location.href);" title="刷新"><i
            class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="Hui-article">
        <article class="cl pd-20">
            <form action="" method="post" class="form form-horizontal" id="form-system-edit">
                <div id="tab-system" class="HuiTab">
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>公司名称：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <input type="text" id="company_name" name="company_name" placeholder="控制在25个字、50个字节以内" value="{$system.company_name}"
                                   class="input-text">
                        </div>
                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>网站域名
                        </label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <input type="text" id="domain" name="domain" placeholder="网站域名" value="{$system.domain}" class="input-text">
                        </div>
                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>红草打赏总计
                        </label>
                        <div class="formControls col-xs-6 col-sm-7">
                            <input type="text" id="redoperator" name="redoperator" placeholder="红草打赏总计" value="{$system.redoperator}" class="input-text" >
                        </div>
                        <button class="btn-danger btn radius col-sm-4 col-xs-3" onclick="result(1)" type="button">结算</button>
                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>蓝草打赏总计
                        </label>
                        <div class="formControls col-xs-6 col-sm-7">
                            <input type="text" id="blueoperator" name="blueoperator" placeholder="蓝草打赏总计" value="{$system.blueoperator}" class="input-text" >
                        </div>
                        <button class="btn-danger btn radius col-sm-4 col-xs-3" onclick="result(2)" type="button">结算</button>

                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>监板打赏总计
                        </label>
                        <div class="formControls col-xs-6 col-sm-7">
                            <input type="text" id="boardScore" name="blueoperator" placeholder="监板打赏总计" value="{$system.boardScore}" class="input-text" >
                        </div>
                        <button class="btn-danger btn radius col-sm-4 col-xs-3" onclick="result(0)" type="button">结算</button>
                    </div>


                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>四扣开关
                        </label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <div class="radio-box">
                                <input type="radio" id="fourenable-1" name="fourenable" value="0" class="radio-box"  <?php if ($system['fourenable']==0) echo 'checked';?>>
                                <label for="fourenable-1">关闭</label>
                            </div>
                            <div class="radio-box">
                                <input type="radio" id="fourenable-2" name="fourenable" value="1" class="radio-box" <?php if ($system['fourenable']==1) echo 'checked';?>>
                                <label for="fourenable-2">开启</label>
                            </div>

                        </div>
                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red"></span>公告
                        </label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <textarea id="notice" name="notice" placeholder="公告" class="textarea">{$system.notice}</textarea>
                        </div>
                    </div>

                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">
                            <span class="c-red">*</span>系统开启登陆
                        </label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <div class="radio-box">
                                <input type="radio" id="status-1" name="status" value="0" class="radio-box"  <?php if ($system['status']==0) echo 'checked';?>>
                                <label for="status-1">关闭</label>
                            </div>
                            <div class="radio-box">
                                <input type="radio" id="status-2" name="status" value="1" class="radio-box" <?php if ($system['status']==1) echo 'checked';?>>
                                <label for="status-2">开启</label>
                            </div>

                        </div>
                    </div>

                </div>
                <div class="row cl">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                        <button onClick="article_save_submit();" class="btn btn-primary radius" type="button" ><i
                                class="Hui-iconfont">&#xe632;</i> 保存
                        </button>
                    </div>
                </div>
            </form>
        </article>
    </div>
</section>

{include file="common/_footer"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
    });

    function article_save_submit() {
        $("#form-system-edit").ajaxSubmit({
            type:'post',
            dataType:'json',
            success:function(data){
                if (data.status==1){
                    $.Huimodalalert("操作成功...",1000);
                }
            }
        })
    }
    function result(who) {
        if (window.confirm("确认结算吗？")){
            $.post("{:url('system/giveResult')}",{who:who},function (data) {
                if(data.status==1){
                    window.location.reload();
                }
            })
        }
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>